package com.zy.studentSide.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zy.studentSide.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * @author CR
 */
@Mapper
@Component
public interface StudentDao extends BaseMapper<Student> {

    /**
     * 根据学生的编号和密码进行查询
     * @param studentNum
     * @param studentPassword
     * @return Student
     */
    @Select("select * from hms_student where student_num=#{studentNum} and student_password=#{studentPassword}")
    Student studentLogin(String studentNum,String studentPassword);

    /**
     * 根据学号查重
     * @param studentNum
     * @return Student
     */
    @Select("select * from hms_student where student_num=#{studentNum}")
    Student getStudentById(String studentNum);

    /**
     * 根据学生id查重
     * @param studentId
     * @return Student
     */
    @Select("select * from hms_student where student_id=#{studentId}")
    Student getStudentByStudentId(Integer studentId);

}
